<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
</head>

<body>
	<script src="">
		Array.prototype.last = function () {
			let length = this.length
			if (this.length == 0) return -1
			return this[length - 1]
			return this.length == 0 ? -1 : this[this.length - 1]
		}
	</script>
	<script>
		var chunk = function (arr, size) {
			let newArr = [],
				index = 0
			for (let i = 0; i < arr.length; i += size) {
				if (i !== 0 && i % size === 0) {
					newArr.push(arr.slice(index, i))
					index = i
				}
			}
			newArr.push(arr.slice(index))

			return newArr
		};
		let arr = [1, 2, 3, 4, 5, 6, 7, 8, 9], size = 2


	</script>
</body>

</html>